package xyz.eden.cloud.common.core.exception;


import lombok.Getter;
import xyz.eden.cloud.common.core.result.ResultSetEnum;

/**
 * 参数异常
 */
@Getter
public class ParameterException extends IllegalArgumentException implements AbstractException {

    /**
     * code
     */
    private Integer code;
    /**
     * message
     */
    private String message;
    /**
     * data
     */
    private ExceptionData exceptionData;

    public ParameterException(String message) {
        this.code = ResultSetEnum.ERROR_PARAM.getCode();
        this.message = message;
    }

    public ParameterException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public ParameterException(Integer code, String message, ExceptionData data) {
        super(message);
        this.code = code;
        this.message = message;
        this.exceptionData = data;
    }

    public ParameterException(Integer code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }
}
